<template>
	<view class="padb20">
		<cu-custom bgColor="bg-gradual-blue" isBack="true">
			<block slot="content">生产详情</block>
		</cu-custom>
		<scroll-view scroll-x class="bg-white nav">
			<view class="cu-item ripple" :class="TabCur==0?'text-orange cur':''" @tap="TabCur = 0" :data-id="0">
				生产任务
			</view>
			<view class="cu-item ripple" :class="TabCur==1?'text-orange cur':''" @tap="TabCur = 1" :data-id="1">
				订单信息
			</view>
		</scroll-view>
		<view class="pad2 bcf" v-show="$com.isTrue(item) && TabCur === 0">
			<view class="list-style-1 martb3 fs14 fwb">生产任务</view>
			<view class="martb3 fwb">{{item.info}}</view>
			<view class="flrc padtb2"><view class="flex1">任务数量</view><view class="fwb">{{item.numTotal}}</view></view>
			<view class="flrc padtb2"><view class="flex1">完成数量</view><view class="fwb">{{item.numTotal}}</view></view>
			<view class="flrc padtb2"><view class="flex1">计划开始</view><view>{{$com.str2time(item.createAt)}}</view></view>
			<view class="flrc padtb2"><view class="flex1">计划完成</view><view>{{$com.str2time(item.targetAt)}}</view></view>
			<view class="flrc padtb2"><view class="flex1">实际开始</view><view>{{$com.str2time(item.startAt)}}</view></view>
			<view class="flrc padtb2"><view class="flex1">实际完成</view><view>{{$com.str2time(item.finishAt)}}</view></view>
			<view class="flrc padtb2"><view class="flex1">责任人</view><view>{{item.point.manageBy.name}}</view></view>
			<view class="flrc padtb5 bdtso"><view class="flex1 list-style-1">任务状态</view><view>
				<view class=" tar padlr3 padtb2 round1 bdso" style="" :style="'background-color: ' + item.status.background + ';color: ' + item.status.color + ';'">
					{{item.status.name}}
				</view>
			</view></view>
			<view class="bdtso padb2"> 
				<view class="list-style-2 martb3">备注信息</view>
				<view>{{info.tips}}</view>
			</view>
			<view class="bdtso"> 
				<view class="list-style-2 martb3">备注附件</view>
				<image v-for="(pic,index) in info.pics" class="w100" :src="$api.getAssetBaseUrl() + pic" mode="widthFix"></image>
			</view>
		</view>
		
		<view class="pad2 bcf" v-if="$com.isTrue(info) && TabCur === 1">
			<view class="list-style-1 martb3 fs14 fwb">订单信息</view>
			<view class="martb3 fwb list-style-2">{{info.info}}</view>
			<view class="flrc padtb2 bdtda"><view class="flex1">订单编号</view><view>{{info.sn}}</view></view>
			<view class="flrc padtb2"><view class="flex1">订单金额</view><view>{{info.num}}</view></view>
			<view class="flrc padtb2"><view class="flex1">下单时间</view><view>{{$com.str2time(info.createAt)}}</view></view>
			<view class="flrc padtb2"><view class="flex1">开始生产</view><view>{{$com.str2time(info.startAt)}}</view></view>
			<view class="flrc padtb2"><view class="flex1">订单完成</view><view>{{$com.str2time(info.finishAt)}}</view></view>
			<view class="flrc padtb2"><view class="flex1">业务员</view><view>{{info.createBy.name}}</view></view>
			<view class="flrc padtb5 bdtso"><view class="flex1 list-style-2">订单状态</view><view>
				<view class=" tar padlr3 padtb2 round1 bdso" style="" :style="'background-color: ' + info.status.background + ';color: ' + info.status.color + ';'">
					{{info.status.name}}
				</view>
			</view></view>
			<view class="bdtso padb2"> 
				<view class="list-style-2 martb3">备注信息</view>
				<view>{{info.tips}}</view>
			</view>
			<view class="bdtso"> 
				<view class="list-style-2 martb3">附件</view>
				<image v-for="(pic,index) in info.pics" class="w100" :src="$api.getAssetBaseUrl() + pic" mode="widthFix"></image>
			</view>
		</view>
	</view>
</template>

<script>
	import api from '../../../static/js/api.js'
	import com from '../../../static/js/com.js'
	import win from '../../../static/js/win.js'
	import list from '../../../static/js/list.js'
	export default {
		data() {
			return {
				item : false,
				info : false,
				TabCur:0
			}
		},
		methods: {
			tabSelect(e){
				
			}
		},
		onLoad(option) {
				console.log(option)
			let id = option.id
			api.get("/api/streamOrderPoints/" + id,{},(res)=>{
				this.item = res.d
				this.info = res.d.streamOrder
				console.log(res)
			})
		}
	}
</script>

<style>

</style>
